#ifndef UNIONROBCONTROLLERHMIINSTANCE_H
#define UNIONROBCONTROLLERHMIINSTANCE_H

#include <QObject>
#include <QWidget>
#include <QDebug>
#include <QTimer>
#include <QTime>
#include <QTextEdit>
#include <QByteArray>
#include <QTcpServer>
#include <QTcpSocket>

#include "unionrobcontrollerhmiinstance_global.h"
#include "_Interface/_interface_hmi.h"
#include "_Interface/_Datastruct.h"
#include "_Interface/_interface_backend.h"


class UNIONROBCONTROLLERHMIINSTANCESHARED_EXPORT UnionRobControllerHMIInstance : public QWidget{
Q_OBJECT
public:
    UnionRobControllerHMIInstance();
    ~UnionRobControllerHMIInstance();

private:
    HmiInterface* pHmi;
    BackendInterface *pBackend;

public:
    QWidget* getUiHandle();

    void timer_FastTimerLoop();
    void timer_SlowTimerLoop();

public:

    void slots_onbtnclicked_ModeSelected(short Mode);

    bool slots_onbtnclicked_vPower();
    bool slots_onbtnclicked_ESTOP();
    void slots_onbtnclicked_Home();

    void slots_onbtnclicked_Setting();
    void slots_onbtnclicked_Edit();
    bool slots_onbtnclicked_Pause();
    bool slots_onbtnclicked_Run();
    bool slots_onbtnclicked_Stop();

    void slots_onbtnclicked_fn1();
    void slots_onbtnclicked_fn2();
    void slots_onbtnclicked_fn3();
    void slots_onbtnclicked_fn4();

    void slots_onbtnclicked_MainScriptStatus();
    void slots_onbtnclicked_SubScriptStatus();
    void slots_onbtnclicked_VisHmi();
    void slots_onbtnclicked_Coordinate(short& Coordinate,int& ToolID, int& WorkID);

    void slots_onbtnpressed_XP();
    void slots_onbtnpressed_YP();
    void slots_onbtnpressed_ZP();
    void slots_onbtnpressed_AP();
    void slots_onbtnpressed_BP();
    void slots_onbtnpressed_CP();

    void slots_onbtnpressed_XN();
    void slots_onbtnpressed_YN();
    void slots_onbtnpressed_ZN();
    void slots_onbtnpressed_AN();
    void slots_onbtnpressed_BN();
    void slots_onbtnpressed_CN();

    void slots_onbtnpressed_E1P();
    void slots_onbtnpressed_E2P();
    void slots_onbtnpressed_E1N();
    void slots_onbtnpressed_E2N();

    void slots_onbtnreleased_XP();
    void slots_onbtnreleased_YP();
    void slots_onbtnreleased_ZP();
    void slots_onbtnreleased_AP();
    void slots_onbtnreleased_BP();
    void slots_onbtnreleased_CP();

    void slots_onbtnreleased_XN();
    void slots_onbtnreleased_YN();
    void slots_onbtnreleased_ZN();
    void slots_onbtnreleased_AN();
    void slots_onbtnreleased_BN();
    void slots_onbtnreleased_CN();

    void slots_onbtnreleased_E1P();
    void slots_onbtnreleased_E2P();
    void slots_onbtnreleased_E1N();
    void slots_onbtnreleased_E2N();

    void slots_onbtnclicked_MannualOverrideP(double& value);
    void slots_onbtnclicked_ProgramOverrideP(double& value);
    void slots_onbtnclicked_MannualOverrideN(double& value);
    void slots_onbtnclicked_ProgramOverrideN(double& value);

    void message_fromBackendMessageCommand(QByteArray Data);
    void message_toBackendMessage(QByteArray& Data);
};

#endif // UNIONROBCONTROLLERHMIINSTANCE_H
